abstract class Animal {
    protected String name;// 名字
    protected String species;// 种类
    protected String breed;// 品种
    protected double price;// 价格

    public Animal(String name, String species, String breed, double price) {
        this.name = name;
        this.species = species;
        this.breed = breed;
        this.price = price;
    }

    public abstract void eat();//吃

    public abstract void sleep();//睡

    public abstract void play(); //玩

    public abstract void bark(); //叫
}

class Cat extends Animal {
    public Cat(String name, String breed, double price) {
        super(name, "猫", breed, price);
    }

    @Override
    public void eat() {
        System.out.println(name + "吃鱼");
    }

    @Override
    public void sleep() {
        System.out.println(name + "睡觉");
    }

    @Override
    public void play() {
        System.out.println(name + "在玩");
        bark();
    }

    @Override
    public void bark() {
        System.out.println(name + "在叫");
    }
}

// 狗类
class Dog extends Animal {
    public Dog(String name, String breed, double price) {
        super(name, "狗", breed, price);
    }

    @Override
    public void eat() {
        System.out.println(name + "吃骨头");
    }

    @Override
    public void sleep() {
        System.out.println(name + "在睡觉");
    }

    @Override
    public void play() {
        System.out.println(name + "在玩");
    }

    @Override
    public void bark() {
        System.out.println(name + "在叫");
    }
}

// 主类
public class Animal3 {
    public static void main(String[] args) {
        Animal cat1 = new Cat("猫1", "美短", 300.5);
        Animal cat2 = new Cat("猫2", "英短", 350.2);

        Animal dog1 = new Dog("狗1", "金毛", 500.5);
        Animal dog2 = new Dog("狗2", "中华田园犬", 450.5);

        cat1.eat();
        cat1.play();
        cat1.sleep();
        System.out.println();
        cat2.eat();
        cat2.play();
        cat2.sleep();
        System.out.println();
        dog1.eat();
        dog1.play();
        dog1.sleep();
        System.out.println();
        dog2.eat();
        dog2.play();
        dog2.sleep();
    }
}
